package com.huang.datebase;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * 删除操作
 */
public class UserDel {

	public void DelById(String id) throws SQLException {

		Connection connection = DbUtil.getConnection();

		String sql = "delete from user_info WHERE id = ?";

		PreparedStatement ps = connection.prepareStatement(sql);

		try {

			ps.setInt(1, Integer.parseInt(id));
			ps.executeUpdate();
		} catch (SQLException throwables) {
			throwables.printStackTrace();
		}finally {
			DbUtil.close(connection,null,ps,null);
		}

	}

}
